package com.xyw.code.platform.common.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 数据库管理
 * </p>
 *
 * @author xyw
 * @since 2020-02-17
 */
@TableName("sys_db")
@Data
public class SysDb extends Model<SysDb> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ID_WORKER_STR)
    private String id;
    /**
     * 数据库类型
     */
    @TableField("db_type")
    private String dbType;
    /**
     * 数据库地址
     */
    private Integer host;
    /**
     * 数据库端口
     */
    private String port;
    /**
     * 数据库名称
     */
    @TableField("db_name")
    private String dbName;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysDb{" +
        ", id=" + id +
        ", dbType=" + dbType +
        ", host=" + host +
        ", port=" + port +
        ", dbName=" + dbName +
        ", username=" + username +
        ", password=" + password +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        "}";
    }
}
